#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	double x;
	cin >> x;
	double ans = 0;
	if (x <= 20)
		ans = x * 2.65;
	else if (x <= 30)
		ans = 20 * 2.65 + (x - 20) * 3.31;
	else
		ans = 20 * 2.65 + 10 * 3.31 + (x - 30) * 3.97;
	cout << fixed << setprecision(2) << ans;
	return 0;
}
